﻿package frEngine.core.mesh
{
    import baseEngine.basic.*;
    import baseEngine.core.*;
    import baseEngine.modifiers.*;
    import frEngine.animateControler.keyframe.*;
    import frEngine.animateControler.skilEffect.*;
    import frEngine.core.*;
    import frEngine.pools.*;
    import frEngine.render.*;
    import frEngine.render.layer.*;
    import frEngine.shader.filters.*;

    public class SwordLightMesh_Normal extends Mesh3D
    {
        private var surface:FrSurface3D;

        public function SwordLightMesh_Normal(param1:String)
        {
            this.surface = new FrSurface3D("");
            super(param1, false, null);
            this.setMateiralBlendMode(EBlendType.BLEND_LIGHT);
            this.material.materialParams.depthWrite = false;
            this.material.materialParams.twoSided = true;
            setLayer(Layer3DManager.swordLayer, false);
            this.surface.addVertexData(FilterName_ID.SKIN_INDICES_ID, 4, true, null);
            this.surface.addVertexData(FilterName_ID.UV_ID, 2, true, null);
            this.surface.addVertexData(FilterName_ID.PARAM0_ID, 4, true, null);
            this.surface.addVertexData(FilterName_ID.POSITION_ID, 4, true, null);
            return;
        }// end function

        public function reinit(param1:RenderList) : void
        {
            this.renderList = param1;
            this.addSurface(this.surface);
            return;
        }// end function

        override public function dispose(param1:Boolean = true) : void
        {
            super.dispose(param1);
            this.surface.download();
            return;
        }// end function

        override public function get bounds() : Boundings3D
        {
            return null;
        }// end function

        override public function getAnimateControlerInstance(param1:int, param2:Modifier = null) : Modifier
        {
            var _loc_3:* = super.getAnimateControlerInstance(param1, param2);
            if (_loc_3 == null)
            {
                switch(param1)
                {
                    case AnimateControlerType.swordLight_Normal:
                    {
                        _loc_3 = param2 ? (param2) : (FrObjectPool.getObject(SwordLightControler_Normal, this));
                        break;
                    }
                    default:
                    {
                        break;
                    }
                }
                if (_loc_3)
                {
                    _animateControlerList[param1] = _loc_3;
                    _loc_3.targetObject3d = this;
                    if (_loc_3 is IRender)
                    {
                        this.render = IRender(_loc_3);
                    }
                }
            }
            return _loc_3;
        }// end function

    }
}
